<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
            input {
                color: #999;
            }
        </style>
    </head>
    <body>
        <input  type="text" value="手机"/>
        <script>
          var text = document.querySelector('input');
          text.onfocus = function () {
              if (this.value =='手机') {
                  this.value ='';
              }
              this.style.color = '#333';
          }
          text.onblur = function () {
              if (this.value=='') {
                  this.value = '手机';
              }
              this.style.color = '#999';
          }
          
        </script>
    </body>
</html>
